<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>学科信息</title>
    <style>
        #container {
            width: 80%;
            margin: 10px auto;
        }
        .user {
            float: right;
            margin-right: 10px;
        }
        .user>a {
            margin-right: 10px;
        }
        #main>dl>dt {
            font-size: 1.5em;
            font-weight: bold;
        }
        #main>dl>dd {
            font-size: 1.2em;
        }
        a {
            text-decoration: none;
            color: darkcyan;
        }
    </style>
</head>
<body>
<div id="container">
{#    <div class="user">#}
{#        <a href="login.html">用户登录</a>#}
{#        <a href="register.html">快速注册</a>#}
{#    </div>#}
    <div class="user">
        {% if request.session.userid %}
            <span>{{ request.session.username }}</span>
            <a href="/logout">注销</a>
        {% else %}
            <a href="/login">登录</a>&nbsp;&nbsp;
        {% endif %}
        <a href="/register">注册</a>
    </div>
    <h1>扣丁学堂所有学科</h1>
    <hr>
    <div id="main">
        {% for subject in subjects %}
            <dl>
                <dt>
                    <a href="/teachers/?sno={{ subject.no }}">{{ subject.name }}</a>
                    {% if subject.is_hot %}
                        <img src="/static/images/hot-icon-small.png">
                    {% endif %}
                </dt>
                <dd>{{ subject.intro }}</dd>
            </dl>
        {% endfor %}
    </div>
</div>
</body>
</html>
